﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using AbstractFramework.LogicControl;

namespace WpfElevator.ControlPart
{
    class Timer : ITimer
    {
        private TimeSpan ts1,ts2;
        public TimeSpan Ts1
        {
            get { return ts1; }
            set { ts1 = value; }
        }
        public void creatTimer()
        {
            //tempTime = DateTime.Now.Millisecond;
            ts1 = new TimeSpan(DateTime.Now.Ticks);
            return;
        }
        public long end()
        {
            ts2 = new TimeSpan(DateTime.Now.Ticks);
            TimeSpan ts = ts2.Subtract(ts1).Duration();
            return (long)ts.TotalMilliseconds;
            // return DateTime.Now.Millisecond - tempTime;
        }
    }
}
